home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Archive / Games / Soundboard / CSoundboardApp.cp < prev    next >
Encoding:
Text File  |  2000-09-28  |  17.7 KB  |  635 lines  |  [TEXT/MPS ]

  1. // ===========================================================================
  2. //    CSoundboardApp.cp                ©1994 Metrowerks Inc. All rights reserved.
  3. // ===========================================================================
  4. //
  5. //    A "do nothing" Soundboard program that you can use as a starter for
  6. //    you own programs.
  7.  
  8. #include "CSoundboardApp.h"
  9. #include "CFilterControl.h"
  10. #include "CQuickTimeWindow.h"
  11. #include "CGrayBox.h"
  12. #include "CAttachment.h"
  13.  
  14. #include "FilterComponent.h"
  15. #include "FilterComponentPrivate.h"
  16.  
  17. #include <LApplication.h>
  18. #include <LGrowZone.h>
  19. #include <LWindow.h>
  20. #include <UMemoryMgr.h>
  21. #include <UDrawingState.h>
  22. #include <URegistrar.h>
  23. #include <UQuickTime.h>
  24.  
  25. #include <LEditField.h>
  26. #include <LTabGroup.h>
  27. #include <LCaption.h>
  28. #include <LStdControl.h>
  29. #include <LDialogBox.h>
  30. #include <UModalDialogs.h>
  31. #include <LModelObject.h>
  32. #include <math.h>
  33.  
  34.  
  35. const ResIDT    WIND_Soundboard        = 200;
  36. const ResIDT    WIND_QuickTimeMovie    = 1300;
  37. const PaneIDT    FirstSliderID         = 2002;
  38. const PaneIDT    LastSliderID         = 2011;
  39. const PaneIDT    LabelIDOffset        = 1000;
  40. const PaneIDT    StatusID             = 'Stat';
  41.  
  42.  
  43. // Menu commands
  44. const CommandT     cmd_EnableFilter    = 13100;
  45. const CommandT    cmd_UseExtGains        = 13103;
  46. const CommandT    cmd_srsFilter        = 13104;
  47. const CommandT    cmd_srsGain            = 13105;
  48. const CommandT    cmd_3DAudio            = 13106;
  49. const CommandT    cmd_XTalk5b            = 13107;
  50. const CommandT    cmd_XTalkJG            = 13110;
  51. const CommandT    cmd_XTalkJGtest        = 13112;
  52. const CommandT    cmd_3DAudioJG        = 13111;
  53. const CommandT    cmd_3DAudio5b        = 13108;
  54. const CommandT    cmd_3DAudioOnly        = 13109;
  55. const CommandT     cmd_SoundBoardW     = 13200;
  56.  
  57. const short        kUninited             = 0;
  58.  
  59. // Declare static data members of CSoundboardApp so others can use them
  60. ComponentInstance    CSoundboardApp::mFilterInstance = 0;
  61. short                CSoundboardApp::mGainValue[kMaxSliders];
  62.  
  63. #ifdef powerc
  64. //    #define PROFILE_604            /* Only works on 604 */
  65. #endif
  66.  
  67. #ifdef PROFILE_604
  68.     void    startData(void);
  69.     void    stopData(void);
  70. #endif
  71.  
  72. // ===========================================================================
  73. //        • Main Program
  74. // ===========================================================================
  75.  
  76.  
  77. void main(void)
  78. {
  79.                                     // Set Debugging options
  80.     SetDebugThrow_(debugAction_Alert);
  81.     SetDebugSignal_(debugAction_Alert);
  82.  
  83.     InitializeHeap(3);                // Initialize Memory Manager
  84.                                     // Parameter is number of Master Pointer
  85.                                     //   blocks to allocate
  86.     
  87.                                     // Initialize standard Toolbox managers
  88.     UQDGlobals::InitializeToolbox(&qd);
  89.     
  90.     new LGrowZone(20000);            // Install a GrowZone function to catch
  91.                                     //    low memory situations.
  92.                                     //    Parameter is size of reserve memory
  93.                                     //    block to allocated. The first time
  94.                                     //    the GrowZone function is called,
  95.                                     //    there will be at least this much
  96.                                     //    memory left (so you'll have enough
  97.                                     //    memory to alert the user or finish
  98.                                     //    what you are doing).
  99.     
  100.     CSoundboardApp    soundApp;        // Create instance of your Application
  101.     soundApp.Run();                    //   class and run it
  102. }
  103.  
  104.  
  105. // ===========================================================================
  106. //        • CSoundboardApp Class
  107. // ===========================================================================
  108.  
  109. // ---------------------------------------------------------------------------
  110. //        • CSoundboardApp
  111. // ---------------------------------------------------------------------------
  112. //    Constructor
  113.  
  114. CSoundboardApp::CSoundboardApp()
  115. {
  116.     LPane        *statusBdrPane;
  117.     int            i;
  118.     ComponentDescription    filterDesc;
  119.     
  120.         // Register classes for objects created from 'PPob' resources
  121.         
  122.     URegistrar::RegisterClass(LEditField::class_ID, (ClassCreatorFunc)LEditField::CreateEditFieldStream);
  123. //    URegistrar::RegisterClass(LTabGroup::class_ID, (ClassCreatorFunc)LTabGroup::CreateTabGroupStream);
  124.     URegistrar::RegisterClass(LCaption::class_ID, (ClassCreatorFunc)LCaption::CreateCaptionStream);
  125. //    URegistrar::RegisterClass(LStdButton::class_ID, (ClassCreatorFunc)LStdButton::CreateStdButtonStream);
  126. //    URegistrar::RegisterClass(LStdCheckBox::class_ID, (ClassCreatorFunc)LStdCheckBox::CreateStdCheckBoxStream);
  127. //    URegistrar::RegisterClass(LDialogBox::class_ID, (ClassCreatorFunc)LDialogBox::CreateDialogBoxStream);
  128.     URegistrar::RegisterClass(LView::class_ID, (ClassCreatorFunc)LWindow::CreateViewStream);
  129.  
  130.     URegistrar::RegisterClass(LWindow::class_ID, (ClassCreatorFunc)LWindow::CreateWindowStream);
  131.     URegistrar::RegisterClass(CQuickTimeWindow::class_ID, (ClassCreatorFunc)CQuickTimeWindow::CreateQuickTimeWindowStream);
  132.     URegistrar::RegisterClass(CSoundboardWindow::class_ID, (ClassCreatorFunc)CSoundboardWindow::CreateSoundboardWindowStream);
  133.     URegistrar::RegisterClass(CGrayBox::class_ID, (ClassCreatorFunc)CGrayBox::CreateGrayBoxStream);
  134.     URegistrar::RegisterClass(CFilterControl::class_ID, (ClassCreatorFunc)CFilterControl::CreateFilterControlStream);
  135.     
  136.     CFilterControl::SetSliderJmpAddress();
  137.     UQuickTime::Initialize();
  138.     
  139.         // A Soundboard program has a single main Window that is
  140.         // displayed on start up. The "Visible on Creation" option
  141.         // for the Window (in its PPob resource) should be OFF,
  142.         // so that you can adjust the Window's contents before
  143.         // displaying it.
  144.         
  145.     mStatusWindow = CSoundboardWindow::CreateSoundboardWindow(WIND_Soundboard, this);
  146.     
  147.         // +++ Add code here to configure Panes inside the Window
  148.     statusBdrPane = mStatusWindow->FindPaneByID('Chsl');
  149.     if (statusBdrPane)
  150.         statusBdrPane->AddAttachment(new C3DBorderAttachment);
  151.  
  152.     for (i=FirstSliderID; i<=LastSliderID; ++i) {
  153.         CFilterControl *filterControlPane = (CFilterControl *)mStatusWindow->FindPaneByID(i);
  154.         if (filterControlPane) {
  155.             filterControlPane->SetSuperModel(mStatusWindow);
  156.             filterControlPane->SetMaxValue(kMaxGain);
  157.             filterControlPane->mLabel = (LCaption *)mStatusWindow->FindPaneByID(i+LabelIDOffset);
  158.         }
  159.     }
  160.  
  161.     SetDefaultSubModel(mStatusWindow); /* Crashes PPC for some reason?! */
  162.  
  163.     // Get initial status string
  164.     SetStatusText(str_IdleStr);
  165.     
  166.     // Init instance stuff
  167.     mFilterComponentID = 0L;
  168.     mFilterInstance = 0L;
  169.         
  170.     // Register (or find) our components
  171.     filterDesc.componentType = filterComponentType;
  172.     filterDesc.componentSubType = 'tim ';
  173.     filterDesc.componentManufacturer = 'tim ';
  174.     filterDesc.componentFlags = 0L;
  175.     filterDesc.componentFlagsMask = 0L;
  176.     
  177.     // Are we debugging?
  178.     #ifdef DEBUG_IT
  179.     
  180.         mFilterNameHdl = NewHandle (sizeof (Str255));
  181.         BlockMove ((Ptr)"\pFilter_Component", (Ptr)(*mFilterNameHdl), sizeof (Str255));
  182.  
  183.         mInfoHdl = NewHandle (sizeof (Str255));
  184.         BlockMove ((Ptr)"\pThis component provides simple filter services.", (Ptr)(*mInfoHdl), sizeof (Str255));
  185.         
  186.         // Register the Filter component
  187.         mFilterComponentID = RegisterComponent (&filterDesc,
  188.             NewComponentRoutineProc(FilterDispatcher), kRegisterGlobally,
  189.             mFilterNameHdl, mInfoHdl, nil);
  190.  
  191.     #else    // We're running as standalone components    
  192.     
  193.         // Find the filter component - You should note that it is perfectly
  194.         // acceptable to do a RegisterComponent call followed by a FindNextComponent
  195.         // call - if you use the same component description, and the
  196.         // RegisterComponent call was successful, then you'll get back the same
  197.         // component ID from FindNextComponent that you got from RegisterComponent.    
  198.         mFilterComponentID = FindNextComponent (nil, &filterDesc);
  199.         
  200.     #endif /*DEBUG_IT    */
  201.     
  202.     OpenFilterComponent();
  203.     UpdateFilterCntls();
  204.     
  205.     mStatusWindow->Show();
  206.     SetSleepTime(0);
  207.     StartIdling();
  208. }
  209.  
  210.  
  211. // ---------------------------------------------------------------------------
  212. //        • ~CSoundboardApp
  213. // ---------------------------------------------------------------------------
  214. //    Destructor
  215.  
  216. CSoundboardApp::~CSoundboardApp()
  217. {
  218.         // +++ Add code here to cleanup (if necessary) before quitting
  219.     UQuickTime::Finalize();
  220.     
  221.     if (mFilterInstance)
  222.         CloseComponent (mFilterInstance);
  223. }
  224.  
  225. // ---------------------------------------------------------------------------
  226. //        • AttemptQuitSelf(Int32    inSaveOption)
  227. // ---------------------------------------------------------------------------
  228. //    Do cleanup
  229.  
  230. Boolean
  231. CSoundboardApp::AttemptQuitSelf(
  232.     Int32    inSaveOption)
  233. {
  234.     if (LApplication::AttemptQuitSelf(inSaveOption)) {
  235.         // Are we debugging?
  236.         #ifdef DEBUG_IT
  237.             if (mFilterInstance) {
  238.                 // Check to see if others are using our component
  239.                 long    instCount = CountComponentInstances ((Component) mFilterInstance);
  240.         
  241.                 if (instCount > 1) {
  242.                     SetStatusText(str_ValidInstancesExist);
  243.                     SysBeep(10);
  244.                     return false;
  245.                 }
  246.             }
  247.         #endif /*DEBUG_IT*/
  248.     
  249.         return true;
  250.     }
  251.     else return false;
  252. }
  253.  
  254.  
  255. // ---------------------------------------------------------------------------
  256. //        • ObeyCommand
  257. // ---------------------------------------------------------------------------
  258. //    Respond to commands
  259.  
  260. Boolean
  261. CSoundboardApp::ObeyCommand(
  262.     CommandT    inCommand,
  263.     void        *ioParam)
  264. {
  265.     Boolean    cmdHandled = true;
  266.     
  267.     switch (inCommand) {
  268.     
  269.         // +++ Add cases here for the commands you handle
  270.         //        Remember to add same cases to FindCommandStatus below
  271.         //        to enable/disable the menu items for the commands
  272.     
  273.         case cmd_EnableFilter:
  274.             if (mFilterInstance) {
  275.                 mEnhanceStereo = !mEnhanceStereo;
  276.                 DoSetEnhanceStereo (mFilterInstance, mEnhanceStereo);
  277.                 SetStatusText(mEnhanceStereo ? str_EnhanceStereoResultOnStr : str_EnhanceStereoResultOffStr);
  278.             }
  279.             break;
  280.  
  281.         case cmd_UseExtGains:
  282.             if (mFilterInstance) {
  283.                 mFilterUsesGains = kExtGainControl;
  284.                 DoSetUseGain (mFilterInstance, mFilterUsesGains);
  285.             }
  286.             break;
  287.  
  288.         case cmd_srsFilter:
  289.             if (mFilterInstance) {
  290.                 mFilterUsesGains = kSRSDiffFilter;
  291.                 DoSetUseGain (mFilterInstance, mFilterUsesGains);
  292.             }
  293.             break;
  294.  
  295.         case cmd_srsGain:
  296.             if (mFilterInstance) {
  297.                 mFilterUsesGains = kSRSDiffGain;
  298.                 DoSetUseGain (mFilterInstance, mFilterUsesGains);
  299.             }
  300.             break;
  301.  
  302.         case cmd_3DAudio:
  303.             if (mFilterInstance) {
  304.                 mFilterUsesGains = k3DAudio;
  305.                 DoSetUseGain (mFilterInstance, mFilterUsesGains);
  306.             }
  307.             break;
  308.  
  309.         case cmd_3DAudio5b:
  310.             if (mFilterInstance) {
  311.                 mFilterUsesGains = k3DAudio5b;
  312.                 DoSetUseGain (mFilterInstance, mFilterUsesGains);
  313.             }
  314.             break;
  315.  
  316.         case cmd_3DAudioOnly:
  317.             if (mFilterInstance) {
  318.                 mFilterUsesGains = k3DAudioOnly;
  319.                 DoSetUseGain (mFilterInstance, mFilterUsesGains);
  320.             }
  321.             break;
  322.  
  323.         case cmd_XTalk5b:
  324.             if (mFilterInstance) {
  325.                 mFilterUsesGains = kXTalk5b;
  326.                 DoSetUseGain (mFilterInstance, mFilterUsesGains);
  327.             }
  328.             break;
  329.             
  330.         case cmd_XTalkJG:
  331.             if (mFilterInstance) {
  332.                 mFilterUsesGains = kXTalkJG;
  333.                 DoSetUseGain (mFilterInstance, mFilterUsesGains);
  334.             }
  335.             break;
  336.  
  337.         case cmd_XTalkJGtest:
  338.             if (mFilterInstance) {
  339.                 mFilterUsesGains = kXTalkJGtest;
  340.                 DoSetUseGain (mFilterInstance, mFilterUsesGains);
  341.             }
  342.             break;
  343.  
  344.         case cmd_3DAudioJG:
  345.             if (mFilterInstance) {
  346.                 mFilterUsesGains = k3DAudioJG;
  347.                 DoSetUseGain (mFilterInstance, mFilterUsesGains);
  348.             }
  349.             break;
  350.  
  351.         case cmd_SoundBoardW:
  352.             if (mStatusWindow->IsVisible())
  353.                 mStatusWindow->Hide();
  354.             else mStatusWindow->Show();
  355.  
  356.             break;
  357.             
  358.         case cmd_Open:
  359.             CQuickTimeWindow::CreateQuickTimeWindow(WIND_QuickTimeMovie, this, true);
  360.  
  361.             break;
  362.             
  363.         default:
  364.             cmdHandled = LApplication::ObeyCommand(inCommand, ioParam);
  365.             break;
  366.     }
  367.     
  368.     return cmdHandled;
  369. }
  370.  
  371.  
  372. // ---------------------------------------------------------------------------
  373. //        • FindCommandStatus
  374. // ---------------------------------------------------------------------------
  375. //    Pass back status of a (menu) command
  376.  
  377. void
  378. CSoundboardApp::FindCommandStatus(
  379.     CommandT    inCommand,
  380.     Boolean        &outEnabled,
  381.     Boolean        &outUsesMark,
  382.     Char16        &outMark,
  383.     Str255        outName)
  384. {
  385.     switch (inCommand) {
  386.     
  387.         // +++ Add cases here for the commands you handle.
  388.         //
  389.         //        Set outEnabled to TRUE for commands that can be executed at
  390.         //        this time.
  391.         //
  392.         //        If the associated menu items can have check marks, set
  393.         //        outUsesMark and outMark accordingly.
  394.         //
  395.         //        Set outName to change the name of the menu item
  396.         
  397.         case cmd_EnableFilter:
  398.             outEnabled = (mFilterInstance != nil);
  399.             outUsesMark = true;
  400.             outMark = mEnhanceStereo ? checkMark : noMark;
  401.             break;
  402.             
  403.         case cmd_UseExtGains:
  404.             outEnabled = (mFilterInstance != nil);
  405.             outUsesMark = true;
  406.             outMark = (mFilterUsesGains == kExtGainControl) ? checkMark : noMark;
  407.             break;
  408.             
  409.         case cmd_srsFilter:
  410.             outEnabled = (mFilterInstance != nil);
  411.             outUsesMark = true;
  412.             outMark = (mFilterUsesGains == kSRSDiffFilter) ? checkMark : noMark;
  413.             break;
  414.             
  415.         case cmd_srsGain:
  416.             #ifndef kConfigGenCrossoverFilter
  417.                 outEnabled = (mFilterInstance != nil);
  418.             #else
  419.                 outEnabled = false;
  420.             #endif
  421.             outUsesMark = true;
  422.             outMark = (mFilterUsesGains == kSRSDiffGain) ? checkMark : noMark;
  423.             break;
  424.             
  425.         case cmd_3DAudio:
  426.             outEnabled = (mFilterInstance != nil);
  427.             outUsesMark = true;
  428.             outMark = (mFilterUsesGains == k3DAudio) ? checkMark : noMark;
  429.             break;
  430.             
  431.         case cmd_3DAudio5b:
  432.             outEnabled = (mFilterInstance != nil);
  433.             outUsesMark = true;
  434.             outMark = (mFilterUsesGains == k3DAudio5b) ? checkMark : noMark;
  435.             break;
  436.             
  437.         case cmd_3DAudioOnly:
  438.             outEnabled = (mFilterInstance != nil);
  439.             outUsesMark = true;
  440.             outMark = (mFilterUsesGains == k3DAudioOnly) ? checkMark : noMark;
  441.             break;
  442.             
  443.         case cmd_XTalk5b:
  444.             outEnabled = (mFilterInstance != nil);
  445.             outUsesMark = true;
  446.             outMark = (mFilterUsesGains == kXTalk5b) ? checkMark : noMark;
  447.             break;
  448.             
  449.         case cmd_XTalkJG:
  450.             outEnabled = (mFilterInstance != nil);
  451.             outUsesMark = true;
  452.             outMark = (mFilterUsesGains == kXTalkJG) ? checkMark : noMark;
  453.             break;
  454.             
  455.         case cmd_XTalkJGtest:
  456.             outEnabled = (mFilterInstance != nil);
  457.             outUsesMark = true;
  458.             outMark = (mFilterUsesGains == kXTalkJGtest) ? checkMark : noMark;
  459.             break;
  460.             
  461.         case cmd_3DAudioJG:
  462.             outEnabled = (mFilterInstance != nil);
  463.             outUsesMark = true;
  464.             outMark = (mFilterUsesGains == k3DAudioJG) ? checkMark : noMark;
  465.             break;
  466.             
  467.         case cmd_Open:
  468.             outEnabled = UQuickTime::QuickTimeIsPresent();
  469.             break;
  470.  
  471.         case cmd_SoundBoardW:
  472.             outEnabled = true;
  473.             ::GetIndString(outName, STRx_ShowHideSoundBoard, mStatusWindow->IsVisible()?
  474.                                 str_HideSoundBoard:str_ShowSoundBoard);
  475.             break;
  476.     
  477.         default:
  478.             LApplication::FindCommandStatus(inCommand, outEnabled, outUsesMark,
  479.                                 outMark, outName);
  480.             break;
  481.     }
  482. }
  483.  
  484.  
  485.  
  486. // ---------------------------------------------------------------------------
  487. //        • SetStatusText
  488. // ---------------------------------------------------------------------------
  489. //    Get status text from STR# resource and update status box
  490.  
  491. void
  492. CSoundboardApp::SetStatusText(short index)
  493. {
  494.     // Get error string
  495.     LEditField    *statusPane = (LEditField    *)mStatusWindow->FindPaneByID('Stat');
  496.     
  497.     if (statusPane) {
  498.         Str255        str;
  499.         
  500.         GetIndString (str, STRx_StatusStrsID, index);
  501.         statusPane->SetDescriptor(str);
  502.         mClipped = 0;
  503.     }
  504.  
  505. }
  506.  
  507. // ---------------------------------------------------------------------------
  508. //        • OpenFilterComponent
  509. // ---------------------------------------------------------------------------
  510. //    Open up an instance of our filter component
  511.  
  512. void
  513. CSoundboardApp::OpenFilterComponent    ()
  514. {
  515.     if (!mFilterInstance && mFilterComponentID) {
  516.  
  517.         // Open the component
  518.         mFilterInstance = (FilterComponent) OpenComponent (mFilterComponentID);
  519.         if (!mFilterInstance)
  520.             SetStatusText(str_DidNotGetInstStr);
  521.         else {
  522.             int i;
  523.             
  524.             mFilterUsesGains = mEnhanceStereo = mChangeCount = kUninited;
  525.             mClipped = 0;
  526.             for (i=0; i<kMaxSliders; ++i)
  527.                 mGainValue[i] = kUninited;
  528.         }
  529.         
  530.     }
  531.     else    // We were not asked to find some kind of Filter component
  532.         SetStatusText(str_DidNotFindCompIDStr);
  533.         
  534. }
  535.  
  536.  
  537. // ---------------------------------------------------------------------------
  538. //        • UpdateFilterCntls
  539. // ---------------------------------------------------------------------------
  540. //    Update the filter controls
  541.  
  542. void
  543. CSoundboardApp::UpdateFilterCntls(void)
  544. {
  545.     if (mFilterInstance)
  546.     {
  547.         short changeCount;
  548.         unsigned short clipped;
  549.         
  550.         DoGetChangeCount(mFilterInstance, &changeCount);
  551.         if (changeCount != mChangeCount)
  552.         {
  553.             short i, enhancedStereo;
  554.             
  555.             changeCount = mChangeCount;
  556.                 
  557.             // Check to see if state of enhanced stereo has changed
  558.             DoGetEnhanceStereo (mFilterInstance, &enhancedStereo);
  559.             if (enhancedStereo != mEnhanceStereo)
  560.             {
  561.                 mEnhanceStereo = enhancedStereo;
  562.                 SetStatusText(mEnhanceStereo ? str_EnhanceStereoResultOnStr : str_EnhanceStereoResultOffStr);
  563.             }
  564.             
  565.             // Check to see if filter is using its built in gain algorithms
  566.             DoGetUseGain(mFilterInstance, &mFilterUsesGains);
  567.             
  568.             // Check to see slider values or labels have changed
  569.             for (i=FirstSliderID; i<=LastSliderID; ++i) {
  570.                 CFilterControl *filterControlPane = (CFilterControl *)mStatusWindow->FindPaneByID(i);
  571.  
  572.                 if (filterControlPane)
  573.                 {
  574.                     unsigned short labelChanges;
  575.                     Str255 labelStr;
  576.                     double filterGain;
  577.                     
  578.                     DoGetGain (mFilterInstance, i-FirstSliderID, &filterGain);
  579.                     if (filterGain != ((double)kMaxGain - mGainValue[i-FirstSliderID])/kMaxGain)
  580.                     {
  581.                         short sliderGain = ceil(kMaxGain - kMaxGain*filterGain - 0.5);
  582.  
  583.                         filterControlPane->SendAESetValue(sliderGain, true);
  584.                         mGainValue[i-FirstSliderID] = sliderGain;
  585.                     }
  586.                     
  587.                     DoGetGainLabel (mFilterInstance, i-FirstSliderID, &labelChanges, labelStr);
  588.                     if (labelChanges != filterControlPane->mLabelChanges)
  589.                     {
  590.                         LCaption *label = filterControlPane->mLabel;
  591.                         
  592.                         if (label)
  593.                         {
  594.                             label->SetDescriptor(labelStr);
  595.                             label->Refresh();
  596.                             
  597.                             if (*labelStr)
  598.                             {
  599.                                 filterControlPane->Show();
  600.                                 label->Show();
  601.                             }
  602.                             else
  603.                             {
  604.                                 filterControlPane->Hide();
  605.                                 label->Hide();
  606.                             }
  607.                         }
  608.                         filterControlPane->mLabelChanges = labelChanges;
  609.                     }
  610.                 }
  611.             }
  612.         }
  613.         DoGetClipped (mFilterInstance, &clipped);
  614.         if ((clipped && !mClipped) || (!clipped && mClipped))
  615.         {
  616.             SetStatusText(clipped ? str_ClippingStr : str_NotClippingStr);
  617.             mClipped = clipped;
  618.         }
  619.     }
  620. }
  621.  
  622. // ---------------------------------------------------------------------------
  623. //        • SpendTime
  624. // ---------------------------------------------------------------------------
  625. //    Idle time: Update the filter controls
  626.  
  627. void
  628. CSoundboardApp::SpendTime(
  629.     const EventRecord&    /* inMacEvent */)
  630. {
  631.     UpdateFilterCntls();
  632. }
  633.  
  634.  
  635.